/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CadastroForn.java
 *
 * Created on 03/12/2009, 11:52:13
 */

package sigbar.view;

import sigbar.access.BDInterface;
import java.util.Vector;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;

/**
 *
 * @author hdhzero
 */
public class CadastroForn extends javax.swing.JDialog {
    private DefaultListModel listModel1 = new DefaultListModel();
    private DefaultListModel listModel2 = new DefaultListModel();
    private DefaultListModel listModel3 = new DefaultListModel();
    private DefaultListModel listModel4 = new DefaultListModel();
    BDInterface bcon;

    /** Creates new form CadastroForn */
    public CadastroForn(java.awt.Frame parent, boolean modal, BDInterface bcon) {
        super(parent, modal);
        initComponents();
        setBcon(bcon);
    }

    public BDInterface getBcon() {
        return bcon;
    }

    public void setBcon(BDInterface bcon) {
        this.bcon = bcon;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        textfieldCNPJ = new javax.swing.JTextField();
        textfieldEmpresa = new javax.swing.JTextField();
        textfieldFantasia = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        textfieldEmailEmp = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        listEmailEmp = new javax.swing.JList();
        buttonRemEmailEmp = new javax.swing.JButton();
        buttonAddEmailEmp = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        listFoneEmp = new javax.swing.JList();
        textfieldFoneEmp = new javax.swing.JTextField();
        buttonAddFoneEmp = new javax.swing.JButton();
        buttonRemFoneEmp = new javax.swing.JButton();
        buttonConfEmp = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        textfieldNome = new javax.swing.JTextField();
        textfieldCPF = new javax.swing.JTextField();
        jPanel7 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        listFonePes = new javax.swing.JList();
        textfieldFonePes = new javax.swing.JTextField();
        buttonAddFonePes = new javax.swing.JButton();
        buttonRemFonePes = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        textfieldEmailPes = new javax.swing.JTextField();
        jScrollPane4 = new javax.swing.JScrollPane();
        listEmailPes = new javax.swing.JList();
        buttonRemEmailPes = new javax.swing.JButton();
        buttonAddEmailPes = new javax.swing.JButton();
        buttonConfPes = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Cadastro de Fornecedor");
        setResizable(false);

        jPanel1.setPreferredSize(new java.awt.Dimension(566, 400));

        jLabel3.setText("Nome Fantasia :");

        jLabel2.setText("Nome da Empresa :");

        jLabel1.setText("CNPJ :");

        textfieldCNPJ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textfieldCNPJActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addGap(26, 26, 26)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textfieldCNPJ, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
                    .addComponent(textfieldFantasia, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
                    .addComponent(textfieldEmpresa, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textfieldCNPJ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textfieldEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textfieldFantasia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel4.setText("E-mail :");

        jScrollPane1.setViewportView(listEmailEmp);

        buttonRemEmailEmp.setText("Remover");
        buttonRemEmailEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonRemEmailEmpActionPerformed(evt);
            }
        });

        buttonAddEmailEmp.setText("Adicionar");
        buttonAddEmailEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAddEmailEmpActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane1)
                    .addComponent(textfieldEmailEmp, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(buttonAddEmailEmp)
                    .addComponent(buttonRemEmailEmp, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textfieldEmailEmp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(buttonAddEmailEmp)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonRemEmailEmp)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel5.setText("Fone :");

        jScrollPane2.setViewportView(listFoneEmp);

        buttonAddFoneEmp.setText("Adicionar");
        buttonAddFoneEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAddFoneEmpActionPerformed(evt);
            }
        });

        buttonRemFoneEmp.setText("Remover");
        buttonRemFoneEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonRemFoneEmpActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                    .addComponent(textfieldFoneEmp, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(buttonAddFoneEmp)
                    .addComponent(buttonRemFoneEmp, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(26, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textfieldFoneEmp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonAddFoneEmp)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonRemFoneEmp))
                .addContainerGap())
        );

        buttonConfEmp.setText("Confirmar Cadastro");
        buttonConfEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonConfEmpActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap(289, Short.MAX_VALUE)
                        .addComponent(buttonConfEmp))
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonConfEmp)
                .addGap(676, 676, 676))
        );

        jTabbedPane1.addTab("Fornecedor Empresa", jPanel1);

        jLabel6.setText("Nome :");

        jLabel7.setText("CPF :");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textfieldNome, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)
                    .addComponent(textfieldCPF, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(textfieldNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(textfieldCPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel8.setText("Fone :");

        jScrollPane3.setViewportView(listFonePes);

        buttonAddFonePes.setText("Adicionar");
        buttonAddFonePes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAddFonePesActionPerformed(evt);
            }
        });

        buttonRemFonePes.setText("Remover");
        buttonRemFonePes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonRemFonePesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
                    .addComponent(textfieldFonePes, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(buttonAddFonePes)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                        .addComponent(buttonRemFonePes, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap(26, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textfieldFonePes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonAddFonePes)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonRemFonePes))
                .addContainerGap())
        );

        jLabel9.setText("E-mail :");

        jScrollPane4.setViewportView(listEmailPes);

        buttonRemEmailPes.setText("Remover");
        buttonRemEmailPes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonRemEmailPesActionPerformed(evt);
            }
        });

        buttonAddEmailPes.setText("Adicionar");
        buttonAddEmailPes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAddEmailPesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(textfieldEmailPes)
                    .addComponent(jScrollPane4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(buttonRemEmailPes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonAddEmailPes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textfieldEmailPes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(buttonAddEmailPes)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonRemEmailPes)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        buttonConfPes.setText("Confirmar Cadastro");
        buttonConfPes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonConfPesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE)
                    .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonConfPes, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
                .addComponent(buttonConfPes)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Fornecedor Pessoa Física", jPanel2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 505, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonRemEmailEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRemEmailEmpActionPerformed
        if ( listEmailEmp.getSelectedIndex() != -1 ) {
            listModel1.removeElement(listEmailEmp.getSelectedValue());
            listEmailEmp.setModel(listModel1);
        } else {
            JOptionPane.showMessageDialog(this, "Selecione um Email de Empresa para remover");
        }
}//GEN-LAST:event_buttonRemEmailEmpActionPerformed

    private void buttonAddEmailEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddEmailEmpActionPerformed
        if ( !(textfieldEmailEmp.getText().equals("")) ) {
            listModel1.addElement(textfieldEmailEmp.getText());
            listEmailEmp.setModel(listModel1);
            textfieldEmailEmp.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Campo de E-mail de Empresa inválido, digite novamente");
        }
}//GEN-LAST:event_buttonAddEmailEmpActionPerformed

    private void buttonAddFoneEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddFoneEmpActionPerformed
        if ( !(textfieldFoneEmp.getText().equals("")) ) {
            listModel2.addElement(textfieldFoneEmp.getText());
            listFoneEmp.setModel(listModel2);
            textfieldFoneEmp.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Campo de Telefone de Empresa inválido, digite novamente");
        }
}//GEN-LAST:event_buttonAddFoneEmpActionPerformed

    private void buttonRemFoneEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRemFoneEmpActionPerformed
        if ( listFoneEmp.getSelectedIndex() != -1 ) {
            listModel2.removeElement(listFoneEmp.getSelectedValue());
            listFoneEmp.setModel(listModel2);
        } else {
            JOptionPane.showMessageDialog(this, "Selecione um Telefone da empresa para remover");
        }
}//GEN-LAST:event_buttonRemFoneEmpActionPerformed

    private void buttonConfEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfEmpActionPerformed
        Vector<String> emails = new Vector<String>();
        Vector<String> fones = new Vector<String>();
        for ( int i = 0; i < listModel1.getSize(); i++ ) {
            emails.addElement(listModel1.getElementAt(i).toString());
        }
        for ( int i = 0; i < listModel2.getSize(); i++ ) {
            fones.addElement(listModel2.getElementAt(i).toString());
        }
        try {
            bcon.cadastrarFornecedorJuridico(textfieldCNPJ.getText(), textfieldEmpresa.getText(),
                                                textfieldFantasia.getText(), emails, fones);
        }
        catch (Exception ex){
            System.out.println(ex.getMessage());
            JOptionPane.showMessageDialog(this, "Não foi possível cadastrar o fornecedor jurídico no banco de dados.");
        }
}//GEN-LAST:event_buttonConfEmpActionPerformed

    private void buttonAddFonePesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddFonePesActionPerformed
        if ( !(textfieldFonePes.getText().equals("")) ) {
            listModel4.addElement(textfieldFonePes.getText());
            listFonePes.setModel(listModel4);
            textfieldFonePes.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Campo de Telefone de Pessoa inválido, digite novamente");
        }
}//GEN-LAST:event_buttonAddFonePesActionPerformed

    private void buttonRemFonePesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRemFonePesActionPerformed
        if ( listFonePes.getSelectedIndex() != -1 ) {
            listModel4.removeElement(listFonePes.getSelectedValue());
            listFonePes.setModel(listModel4);
        } else {
            JOptionPane.showMessageDialog(this, "Selecione um Telefone de Pessoa para remover");
        }
}//GEN-LAST:event_buttonRemFonePesActionPerformed

    private void buttonRemEmailPesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRemEmailPesActionPerformed
        if ( listEmailPes.getSelectedIndex() != -1 ) {
            listModel3.removeElement(listEmailPes.getSelectedValue());
            listEmailPes.setModel(listModel3);
        } else {
            JOptionPane.showMessageDialog(this, "Selecione um Email de Pessoa para remover");
        }
}//GEN-LAST:event_buttonRemEmailPesActionPerformed

    private void buttonAddEmailPesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddEmailPesActionPerformed
        if ( !(textfieldEmailPes.getText().equals("")) ) {
            listModel3.addElement(textfieldEmailPes.getText());
            listEmailPes.setModel(listModel3);
            textfieldEmailPes.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Campo de Email de Pessoa inválido, digite novamente");
        }
}//GEN-LAST:event_buttonAddEmailPesActionPerformed

    private void buttonConfPesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfPesActionPerformed
        Vector<String> emails = new Vector<String>();
        Vector<String> fones = new Vector<String>();
        for ( int i = 0; i < listModel3.getSize(); i++ ) {
            emails.addElement(listModel3.getElementAt(i).toString());
        }
        for ( int i = 0; i < listModel4.getSize(); i++ ) {
            fones.addElement(listModel4.getElementAt(i).toString());
        }
        try {
            bcon.cadastrarFornecedorFisico(textfieldCPF.getText(), textfieldNome.getText(), emails, fones);
        }
        catch (Exception ex){
            System.out.println(ex.getMessage());
            JOptionPane.showMessageDialog(this, "Não foi possível cadastrar o fornecedor físico no banco de dados.");
        }

    }//GEN-LAST:event_buttonConfPesActionPerformed

    private void textfieldCNPJActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textfieldCNPJActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_textfieldCNPJActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonAddEmailEmp;
    private javax.swing.JButton buttonAddEmailPes;
    private javax.swing.JButton buttonAddFoneEmp;
    private javax.swing.JButton buttonAddFonePes;
    private javax.swing.JButton buttonConfEmp;
    private javax.swing.JButton buttonConfPes;
    private javax.swing.JButton buttonRemEmailEmp;
    private javax.swing.JButton buttonRemEmailPes;
    private javax.swing.JButton buttonRemFoneEmp;
    private javax.swing.JButton buttonRemFonePes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JList listEmailEmp;
    private javax.swing.JList listEmailPes;
    private javax.swing.JList listFoneEmp;
    private javax.swing.JList listFonePes;
    private javax.swing.JTextField textfieldCNPJ;
    private javax.swing.JTextField textfieldCPF;
    private javax.swing.JTextField textfieldEmailEmp;
    private javax.swing.JTextField textfieldEmailPes;
    private javax.swing.JTextField textfieldEmpresa;
    private javax.swing.JTextField textfieldFantasia;
    private javax.swing.JTextField textfieldFoneEmp;
    private javax.swing.JTextField textfieldFonePes;
    private javax.swing.JTextField textfieldNome;
    // End of variables declaration//GEN-END:variables

}
